package com.gezi.admin.module.config;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gezi.admin.config.mybatis.handler.MybatisDateTypeHandler;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * @Author 格子代码
 * @createDate 2024/2/10 09:00
 * @contact 1424529270@qq.com
 */
@Data
public class BaseEntity implements Serializable {

    @TableId(type = IdType.ASSIGN_UUID)
    @TableField(value = "id")
    private String id;

    @TableField(fill = FieldFill.INSERT,value = "create_by")
    private String createBy;

    @TableField(fill = FieldFill.INSERT,value = "create_time",typeHandler = MybatisDateTypeHandler.class)
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss",locale = "zh")
    private Date createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE,value = "update_by")
    private String updateBy;

    @TableField(fill = FieldFill.INSERT_UPDATE,value = "update_time",typeHandler = MybatisDateTypeHandler.class)
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss",locale = "zh")
    private Date updateTime;

    @TableField(value = "del_flag")
    @TableLogic(value = "0",delval = "1")
    private String delFlag = "0";
}
